
CPP = g++ 
CPPFLAGS = -g -O0 -std=c++11
TARGET = netmain

all: $(TARGET)

INCLUDE_DIRS = 
SRC_DIRS = . 
LIBS = -lpthread

SRCS = $(shell find $(SRC_DIR) -name "*.cpp")

OBJS=$(SRCS:%.cpp=obj/%.o) 


$(OBJS):obj/%.o : %.cpp
	$(shell mkdir -p $(dir $@))
	$(CPP) $(CPPFLAGS) -o $@ -c $< $(INCLUDE_DIRS)

$(TARGET):$(OBJS)
	$(CPP) -o $@ $(OBJS) $(LIBS)

#$(warning $(SRCS))
#$(warning $(OBJS))
#$(warning $(dir $(SRCS)))

.PHONY: clean
clean:
	rm -rf $(TARGET) $(OBJS)